/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * FrmAplicarEval.java
 *
 * Created on 19/02/2011, 12:41:51 AM
 */
package interfaz1;

import java.awt.Frame;
import javax.swing.JOptionPane;

/**
 *
 * @author CLIENTE
 */
public class FrmAplicarEval extends javax.swing.JFrame {

    /** Creates new form FrmAplicarEval */
    public FrmAplicarEval() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lblapleva = new javax.swing.JLabel();
        btnapleva = new javax.swing.JButton();
        btnsalirapev = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Evaluaciones");
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        lblapleva.setFont(new java.awt.Font("Bookman Old Style", 1, 12));
        lblapleva.setText("Aplicar Evaluaciones");
        getContentPane().add(lblapleva, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 10, -1, 30));

        btnapleva.setText("Aplicar Evaluaciones");
        btnapleva.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnaplevaActionPerformed(evt);
            }
        });
        getContentPane().add(btnapleva, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 100, 130, 30));

        btnsalirapev.setText("Salir");
        btnsalirapev.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnsalirapevActionPerformed(evt);
            }
        });
        getContentPane().add(btnsalirapev, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 100, 120, 30));

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-423)/2, (screenSize.height-226)/2, 423, 226);
    }// </editor-fold>//GEN-END:initComponents

    private void btnsalirapevActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnsalirapevActionPerformed

        // TODO add your handling code here:
        dispose();
    }//GEN-LAST:event_btnsalirapevActionPerformed

    private void btnaplevaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnaplevaActionPerformed
        // TODO add your handling code here:
        if (FrmOperacionesseccion.isEncon3() == true) {
            if (FrmOperacionesseccion.isEncon() == true && FrmOperacionesseccion.isEncon1() == true) {
                FrmOperacionesseccion.getMiseccion().AplicarEvaluacion(FrmOperacionesseccion.getMiprofesor());
                FrmOperacionesseccion.setEncon2(true);
                FrmOperacionesseccion.setEncon3(false);
                JOptionPane.showMessageDialog(new Frame(), "Se han aplicado las evaluciones", "Aviso", JOptionPane.PLAIN_MESSAGE);
                dispose();

            } else {
                JOptionPane.showMessageDialog(new Frame(), "No se pueden aplicar evaluaciones", "Aviso", JOptionPane.PLAIN_MESSAGE);
            }
        } else {
            JOptionPane.showMessageDialog(new Frame(), "Ya estan aplicadas las evaluaciones", "Aviso", JOptionPane.PLAIN_MESSAGE);
        }
    }//GEN-LAST:event_btnaplevaActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new FrmAplicarEval().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnapleva;
    private javax.swing.JButton btnsalirapev;
    private javax.swing.JLabel lblapleva;
    // End of variables declaration//GEN-END:variables
}
